<%@ include file="/jsp/include/header.jsp"%>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<head>
 <script type='text/javascript' src='<%=ctx%>/dwr/engine.js'></script>
 <script type='text/javascript' src='<%=ctx%>/dwr/interface/dwrService.js'></script>
 <script type='text/javascript' src='<%=ctx%>/dwr/util.js'></script>

<title >${applicationScope.webTitle}</title>
</head>  
<script type="text/javascript" charset="UTF-8">
	var f1,d1;
	$(function() {
		
		f1 = $('#f1').form();
		d1 = $('#d1').show().dialog({
			modal : true,
			closable:false,
			draggable:false,
			title : '首页',
			buttons : [ {
				text : '登录',
				handler :login
			}]
		});
		 
		$("input[name=user_code]").keydown(function(event){
			if(event.keyCode==13){
				login()
			}
		});
		$("input[name=password]").keydown(function(event){
			if(event.keyCode==13){
				login()
			}
		});
		if($.cookie('rmb')){
			$("input[name=user_code]").val($.cookie('usercode'));
			$("input[name=password]").val($.cookie('password'));
			$("input[name=rmb]").attr("checked","checked");
			//login();
		}
	});
	function login(){

		var data=JSON.stringify(f1.form("serialize"));
		$("input[name=data]").val(data);
		if(f1.form('validate')){
			$.messager.progress({
			text : '登录请求中....',
			interval : 100
			});
			var user=new Object();
			user.user_code=$("input[name=user_code]").val();
			user.password=$("input[name=password]").val();
			dwrService.accessLogin(user);
		} 
	}
</script>
<body>
 <div id="d1" style="overflow: hidden;vertical-align:middle;">
		<form id="f1" method="post">
		<input type="hidden" name="data" />
		 <table class="tableForm">
		  <tr>
 				<td style="width:80px;"   ><div class="show-tip icon-user" style="float:left"></div>用户名</td>
			    <td style="width:120px;" >    
				<input name="user_code" style="width:100px" class="easyui-validatebox" data-options="validType:'length[4,10]',required:true"   />
			   
			    </td>
		</tr>
		 <tr>  
				<td style="width:80px;" ><div class="show-tip icon-key" style="float:left"></div>密码 </td>
			    <td style="width:120px;">
				<input name="password" style="width:100px"   type="password"  class="easyui-validatebox"  data-options="required:true"  /> 
			    </td>
			   </tr>
		 <tr>  
				<td style="width:80px;" ><div class="show-tip icon-lock" style="float:left"></div>记住我</td>
			    <td style="width:120px;" >
				 <input name="rmb"      type="checkbox" />
			    </td>
			   </tr>
		 </table>
		 </form>
	</div>
 </body>
</html>